#pragma once
// -------------------------------------------------
// BlinKit - BlinKit Library
// -------------------------------------------------
//   File Name: shadow_root_init.h
// Description: ShadowRootInit Class
//      Author: Ziming Li
//     Created: 2022-04-11
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#ifndef BLINKIT_SHADOW_ROOT_INIT_H
#define BLINKIT_SHADOW_ROOT_INIT_H

#include <optional>

namespace blink {

class ShadowRootInit
{
public:
    bool hasMode(void) const { return m_mode.has_value(); }
    const std::string& mode(void) const
    {
        ASSERT(hasMode());
        return m_mode.value();
    }
    void SetMode(const std::string &mode) {
        m_mode = mode;
    }

    bool hasDelegatesFocus(void) const { return m_delegatesFocus.has_value(); }
    bool delegatesFocus(void) const
    {
        ASSERT(hasDelegatesFocus());
        return m_delegatesFocus.value();
    }
    void SetDelegatesFocus(bool b) {
        m_delegatesFocus = b;
    }
private:
    std::optional<std::string> m_mode;
    std::optional<bool> m_delegatesFocus;
};

} // namespace blink

#endif // BLINKIT_SHADOW_ROOT_INIT_H
